import request from '@/utils/request'

export default {
  getCatalogTree(params) {
    return request({
      url: '/public/catalog/tree',
      method: 'get',
      params: params
    })
  },
  createCatalog(data) {
    return request({
      url: '/public/catalog/create',
      method: 'post',
      data
    })
  },
  updateCatalog(data) {
    return request({
      url: `/public/catalog/update/${data.id}`,
      method: 'put',
      data
    })
  },
  deleteCatalog(data) {
    return request({
      url: '/public/catalog/delete',
      method: 'delete',
      data
    })
  }
}
